<template>
  <div class="page" :style="{height:winHeight+'px'}">
  
    <div>
  
      <input type="text" name="info" v-model="info" placeholder="描述密码账号的文字,避免直接使用账号">
  
      <input type="text" name="passwd" v-model="passwd" placeholder="需要保存的密码">
  
      <a @click="adds">添加</a>
  
    </div>
  
  </div>
</template>

<script>
  export default {
    props:[
      'winHeight',

    ],
  
    data() {
  
      return {
  
        info: "",
  
        passwd: "",
  
        userid: "1"
  
      };
  
    },
  
    methods: {
  
      adds: function() {
  
  
  
        var _self = this
  
        $.ajax({
  
          url: "http://127.0.0.1/api/add",
  
          type: "get",
  
          data: {
  
            userid: _self.userid,
  
            passwd: _self.passwd,
  
            name: _self.info
  
          },
  
          success: function(data) {
  
            console.log(data);
  
            //   console.log(_self.userid, _self.passwd, _self.info);
  
          }
  
        });
  
      }
  
    }
  
  };
</script>

<style scoped>
  
</style>
